package com.guomao;

public class ThrowableDemoC {

    public static void main(String[] args) {


        //alt + shift + z
        try {
            int x = 10;
            int y = 0;
//            int z = x / y;
            int[] arr = {1, 2, 3};
//            int xx = arr[10];
//            System.out.println(arr[10]);
        } catch (ArithmeticException e) {
            e.printStackTrace();
        } catch (ArrayIndexOutOfBoundsException e) {

        } finally {
            //无论当前程序是否有异常 该分支代码一定汇之星
            System.out.println("finally invoke...");
            //释放资源
            //关闭流
        }
    }
}
